(deftemplate nationalitate
    (slot casa)
    (slot nationalitate)
    )
(deftemplate animaldecompanie
    (slot casa)
    (slot animal)
    )
(deftemplate tigari
    (slot casa)
    (slot tigari)
    )
(foreach ?casa(create$ casa1 casa2 casa3)
	(foreach ?nationalitate (create$ englez rus spaniol)
		(assert(nationalitate(casa ?casa)(nationalitate ?nationalitate)))
	)
)
(foreach ?casa(create$ casa1 casa2 casa3)
	(foreach ?animaldecompanie (create$ caine lup cal)
		(assert(animaldecompanie(casa ?casa)(animal ?animal)))
	)
)
(foreach ?casa(create$ casa1 casa2 casa3)
	(foreach ?tigari (create$ LM Kent LS)
		(assert(tigari(casa ?casa)(tigari ?tigari)))
	)
)
(defrule rezolvare
	(nationalitate (casa casa1)(nationalitate englez))
    (animaldecompanie (casa casa1)(animal ?animal | lup))
    (tigari (casa casa1)(tigari ?tigari))
    
    (nationalitate (casa casa2)(nationalitate ?nationalitate))
    (animaldecompanie (casa casa1)(animal ?animal | lup))
    (tigari (casa casa1)(tigari ?tigari | LS))
    
    (nationalitate (casa casa2)(nationalitate ?nationalitate | rus))
    (animaldecompanie (casa casa1)(animal ?animal | cal))
    (tigari (casa casa1)(tigari ?tigari | LS))
	
	=>
	(printout t " = " ?p1 " " ?c1 crlf)
)